package cn.com.server.service;


import java.util.List;

import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;

import com.github.pagehelper.Page;

public interface MongoDBService {
    
    void save(Object obj);
    
    void insert(Object obj);
    
    <T> T findOne(Class<T> clazz, Query query);
    
    <T> List<T> findAll(Class<T> clazz);
    
    <T> List<T> find(Class<T> clazz, Query query);
    
    /**
     * 分页查询
     */
    <T> Page<T> getPagination(Class<T> clazz,Query query,int currentPage,int pageSize);
    
    <T> int update(Query query, Update update, Class<T> clazz);

	boolean remove(Object object);
	
	<T> int  remove(Query query, Class<T> clazz);

	String getId(String name);

}
